home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9020 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: news.umbc.edu!not-for-mail
  2. From: schlein@umbc.edu (Jonas J. Schlein)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: A question on for loop..
  5. Date: 7 Mar 1996 18:28:24 -0500
  6. Organization: University of Maryland Baltimore County
  7. Message-ID: <4hnreo$55c@umbc9.umbc.edu>
  8. References: <4hn80a$98q@male.EBay.Sun.COM>
  9. NNTP-Posting-Host: umbc9.umbc.edu
  10. NNTP-Posting-User: schlein
  11.  
  12. Murali Chari <murali@sooraj.ebay.sun.com> wrote:
  13. |> In the following piece of code:
  14. |> 
  15. |> for(i=0;i< 20; i++)
  16. |> {
  17. ...
  18. |>   if(condition==FALSE)
  19. |>   continue;
  20. ...
  21. |> } 
  22. |> 
  23. |> Let us assume i=10 before it entered the loop.
  24. |> The condition was false. So the continue statement
  25. |> got executed.
  26. |> 
  27. |> Will control now go to the third statement in the for loop?
  28. |> i.e. will i be incremented by 1 and again tested for the condition?
  29.  
  30. Continue does exactly that. It says continue to the next loop iteration.
  31. Do not pass go do not pass $200 ;-). So, yes 'i' will be incremented
  32. and tested again. I'll just assume that FALSE is defined somewhere
  33. as well as 'condition'.
  34. -- 
  35. "If it wasn't for C, we would be using BASI, PASAL, and OBOL."
  36.  
  37. Jonas J. Schlein  (schlein@gl.umbc.edu)
  38.